Carbon


FSpDelete

Header: Files.h Carbon status: Supported

Deletes files and directories.

OSErr FSpDelete (
    const FSSpec *spec
);
Parameter descriptions
spec

A pointer to an FSSpec structure specifying the file or directory to delete.

function result

A result code.

DISCUSSION

If the specified target is a file, both forks of the file are deleted. The file ID reference, if any, is removed.

A file must be closed before you can delete it. Similarly, a directory must be empty before you can delete it. If you attempt to delete an open file or a nonempty directory, FSpDelete returns the result code fBsyErr. FSpDelete also returns the result code fBsyErr if the directory has an open working directory associated with it.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)